import java.io.*;
import java.util.*;

class pi {
    public static void main(String args[]) {
	Random rand = new Random();

	long in = 0;
	long out = 0;
	long count = 0;

	while (true) {
	    double x = Math.abs(rand.nextDouble());
	    double y = Math.abs(rand.nextDouble());

	    double z = x*x+y*y;
	    if (z <= 1.0) 
		in++;
	    else
		out++;

	    count++;

	    if (count % 1000 == 0) {
		System.out.println("" + count + " " + ((double)in/(double)count) + " " + Math.PI / 4.0);
	    }
	}
    }
}